import request from '@/utils/request'
/**
 * 获取角色数据
 */
export const reqGetRoleList = (page, pagesize = 10) => {
  return request({
    method: 'get',
    url: '/sys/role',
    params: {
      page,
      pagesize
    }
  })
}
/**
 * 删除角色
 */
export const reqDelRole = (id) => {
  return request({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}
/**
 * 添加角色
 */
export const reqAddRole = (form) => {
  return request({
    method: 'post',
    url: '/sys/role',
    data: form
  })
}

/**
 * 获取角色信息
 */
export const reqGetRoleDetail = (id) => {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}

/**
 * 修改角色信息
 */
export const reqSetAddRole = (data) => {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}

